#include <iostream>
#include <string>
#include <vector>
#include <tuple>

using namespace std;

class shoppingCart {
private:
    shoppingCart() {}
    shoppingCart(const shoppingCart&) = delete;
    void operator=(const shoppingCart&) = delete;

public:
    void push(const string& comm, const int cnt) {
        _commodities.push_back({ comm, cnt });
    }

public:
    static shoppingCart _singletion;
    vector<tuple<string, int> > _commodities;
};

shoppingCart shoppingCart::_singletion;

int main()
{
    string comm;
    int cnt;
    while (cin >> comm >> cnt) {
        shoppingCart::_singletion.push(comm, cnt);
    }

    for (auto &[key, val] : shoppingCart::_singletion._commodities) {
        cout << key << " " << val << endl;
    }
    return 0;
}